PROGRAM := basic_stack
SRC := $(PROGRAM).c
OBJ := $(PROGRAM).o
ASM := $(PROGRAM).s
_ASM := $(PROGRAM)_disasm.txt

ifeq ($(TARGET),)
TARGET := $(OBJ)
endif

all: $(TARGET)

$(OBJ): $(SRC)
	$(GCC) $(GCC_FLAG) $< -o $@

objdump: $(OBJ)
	$(OBJDUMP) $(OBJ_FLAG) $< > $(_ASM)

dump: $(OBJ)
	$(OBJTOOL) --dump $<

orc: $(OBJ)
	$(OBJTOOL) -o $<

clean:
	rm -rf *.o *.txt

.PHONY: clean objdump dump orc
